<?php
class CheckRencanaPenanaman{
	private $tahun;
	private $db;
	
	function CheckRencanaPenanaman($db=NULL, $tahun=NULL){
		$this->tahun = $tahun;
		$this->db   = $db;
	}	
	
	function response(){
		$q = "SELECT COUNT(*) FROM `caramel_operational`.`penanaman_rencana` WHERE `tahun`='".$this->tahun."'";
		$r = $this->db->get_var($q);
		
		if( $r > 0 )
			echo "false";
		else
			echo "true";
	}	
}

$tahun = $_GET['tahun'];


// load database class handler
include_once '../config/db_config.php';
include '../library/ezsql/shared/ez_sql_core.php';
include '../library/ezsql/mysql/ez_sql_mysql.php';

// database handler
$db = new ezSQL_mysql($dbUser, $dbPass, $dbName, $dbHost);

$finder = new CheckRencanaPenanaman($db, $tahun);
$finder->response();
?>